package main

/*
* Author: JacksonCoder
* CreateTime: 2024/11/20
 */

import "fmt"

// 声明全局变量  方法一  方法二  方法三
var gA int = 100
var gB = 200

func main() {
	var b int
	fmt.Println("b = ", b)

	var c = 20
	fmt.Println("c = ", c)
	fmt.Printf("type of c = %T\n", c)

	var d int = 30

	fmt.Println("d = ", d)

	a := 10 // 不支持全局
	fmt.Println("a = ", a)

	var xx, yy int = 100, 200
	fmt.Println("xx = ", xx, "yy = ", yy)

	var kk, ll = 100, "Aceld"
	fmt.Println("kk = ", kk, "ll = ", ll)

	var (
		vv int     = 100
		st bool    = true
		kl string  = "hello world!"
		xs float64 = 234.14
		oe float32 = 32.34
		iq bool    = true
	)
	fmt.Println("vv = ", vv, "st = ", st, "kl = ", kl, "xs = ", xs, "oe = ", oe, "iq = ", iq)
	fmt.Printf("type of vv = %T\n", vv)
	fmt.Printf("type of st = %T\n", st)
	fmt.Printf("type of kl = %T\n", kl)
	fmt.Printf("type of xs = %T\n", xs)
	fmt.Printf("type of oe = %T\n", oe)

	// method of 4
	e := 100
	fmt.Println("e = ", e)
	fmt.Printf("type of e = %T\n", e)

	f := "adfasdf"
	fmt.Println("f = ", f)
	fmt.Printf("type of f = %T\n", f)

	g := 3.14
	fmt.Println("g = ", g)
	fmt.Printf("type of g = %T\n", g)

	// =======
	fmt.Println("gA = ", gA, "gB = ", gB)
}
